from django.db import models
from assistinfo.models import *
from  baseinfo.models import *


# Create your models here.

class PurchaseOrder(models.Model):
    supplier = models.ForeignKey(Supplier, verbose_name='供应商')
    order_date = models.DateField(verbose_name='单据日期')
    productlist = models.ManyToManyField(Product, verbose_name='商品')
    comment = models.TextField(verbose_name='备注', max_length=4000)
    discount_pect = models.DecimalField(verbose_name='优惠率', default=0, max_length=200, max_digits=200,
                                        decimal_places=2)
    pay_discount = models.DecimalField(verbose_name='优惠付款', default=0, max_length=200, max_digits=200,
                                       decimal_places=2)

    def __str__(self):
        return self.comment

    class Meta:
        verbose_name_plural = verbose_name = '采购单'
